package org.lanyu.springainovel.common.event;

import lombok.Getter;
import org.lanyu.springainovel.common.entity.AiMcp;
import org.springframework.context.ApplicationEvent;

import java.util.List;

/**
 * MCP配置响应事件
 */
@Getter
public class McpConfigResponseEvent extends ApplicationEvent {

    private final List<AiMcp> mcpList;
    private final boolean success;
    private final String errorMessage;

    /**
     * 成功响应
     */
    public McpConfigResponseEvent(Object source, List<AiMcp> mcpList) {
        super(source);
        this.mcpList = mcpList;
        this.success = true;
        this.errorMessage = null;
    }

    /**
     * 失败响应
     */
    public McpConfigResponseEvent(Object source, String errorMessage) {
        super(source);
        this.mcpList = null;
        this.success = false;
        this.errorMessage = errorMessage;
    }

}
